﻿using B.S.XZYData.Domain.RBAC;
using B.S.XZYData.Infrastructure.Interface;

namespace B.S.XZYData.Api.Read.Common
{
    public class IdentivyService : IIdentivyService
    {
        private readonly IHttpContextAccessor httpContextAccessor;

        public IdentivyService(IHttpContextAccessor httpContextAccessor)
        {
            this.httpContextAccessor = httpContextAccessor;
            this.Uid = httpContextAccessor.HttpContext.User.FindFirst("UserId")?.Value;
            this.Uname = httpContextAccessor.HttpContext.User.FindFirst("UserName")?.Value;
        }
        public string? Uid { get; set; }
        public string? Uname { get; set; }
    }
    public interface IIdentivyService
    {
        public string? Uid {  get; set; }
        public string? Uname { get; set; }
    }
}
